package com.xhd.server;

public class XShutdownHook extends Thread {
	
	private static boolean shutDowned = false;

	public XShutdownHook() {
		super("Xserver shutdown hook");
		setPriority(10);
		setDaemon(true);
	}

	public XShutdownHook(String paramString) {
		super(paramString);
		setPriority(10);
		setDaemon(true);
	}

	public void run() {
		if (shutDowned)
			return;
		try {
			shutDowned = true;
			ServerConfig.Event.onEvent(EventObject.TIME_AFTER
					| EventObject.EVENT_STOP_SYS);
		} catch (Throwable localThrowable) {
			localThrowable.printStackTrace();
		}
	}
}
